<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCartsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('carts', function (Blueprint $table) {
            $table->unsignedInteger('id');
            $table->unsignedInteger('user_id')->index();
            $table->string('email',100);
            $table->string('company',50)->index();
            $table->string('name',50);
            $table->string('fname',50)->nullable();
            $table->string('homepage',50)->nullable();
            $table->unsignedInteger('catid',3)->index();
            $table->unsignedInteger('price')->index();
            $table->string('content');
            $table->text('attachment');
            
            
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('carts');
    }
}
